require.config({
    baseUrl: './metro',
    paths: {
        angular: '/assets/angular/angular',
        ngSort: '/assets/angular/ng-sortable',
        ngAnimate: '/assets/angular/angular-animate.min',
        uiRouter: '/assets/angular/angular-ui-router.min',
        slimscroll: '/assets/jquery-slimscroll/jquery.slimscroll.min',
        leaflet: '/assets/leaflet/leaflet',
        leafletdraw: '/assets/leaflet/leaflet.draw',
        highcharts: '/assets/highcharts/highcharts',
        crossingSpecificValue: '/assets/highcharts/crossingSpecificValue',
        exporting: '/assets/highcharts/exporting',
        jsonConverters: '/assets/jsonconverter/jsonConverters',
        jsonpack: '/assets/jsonpack/jsonpack',
        calendar: '/assets/jquery/jquery.calendar',
        slides: '/assets/jquery/jquery.slides',
        Sortable: '/assets/Sortable',
        leafletawe: '/assets/leaflet/leaflet.awesome-markers',
        base64: '/assets/base64.min',
        canvg: '/assets/canvg/canvg',
        rgbcolor: '/assets/canvg/rgbcolor',
        StackBlur: '/assets/canvg/StackBlur',
        jspdf: '/assets/jsPDF/jspdf',
        jspdfAddImage: '/assets/jsPDF/jspdf.plugin.addimage',
        FileSaver: '/assets/jsPDF/FileSaver.min',
        plupload: "/assets/plupload/plupload.full.min",
        pluploadCn: '/assets/plupload/i18n/zh_CN',
        qiniu: '/assets/qiniu/qiniu',
        lightbox: '/assets/jquery/lightbox',
        app: './app'
    },
    shim: {
        'angular': {
            'exports': 'angular'
        },
        'leaflet': {
            'exports': 'leaflet'
        },
        'ngSort': ['angular'],
        'leafletawe': ['leaflet'],
        // 'jquery': {
        //     'exports': 'jquery'
        // },
        // 'bootstrap': ['jquery'],
        // 'metronic': ['jquery'],
        // 'slimscroll': ['jquery'],
        // 'lightbox': ['jquery'],
        // 'jquerySortable': ['jquery'],
        'jsonpack': {
            'exports': 'jsonpack'
        },
        'jsonConverters': {
            'exports': 'jsonConverters'
        },
        // 'calendar': ['jquery'],
        // 'slides': ['jquery'],
        // 'highcharts': ['jquery'],
        'crossingSpecificValue': ['highcharts'],
        'exporting': ['highcharts'],
        'leafletdraw': ['leaflet'],
        'jspdfAddImage': ['jspdf'],
        'uiRouter': ['angular'],
        "ngAnimate": ['angular'],
        'pluploadCn': ['plupload'],
        'qiniu': ['plupload'],
        app: ['angular', 'uiRouter']
    }
});

require(['slimscroll', 'angular', 'highcharts', 'uiRouter', 'ngSort', 'leaflet', 'ngAnimate', 'leafletawe', 'app', 'base64', 'plupload', 'pluploadCn', 'qiniu'], function () {
    'use strict';
    L.Icon.Default.imagePath = '/images';
    //手动启动app
    angular.element().ready(function () {
        var htmlElement = document.getElementsByTagName("html")[0];
        var $html = angular.element(htmlElement);
        $html.attr("data-ng-app", "App");
        $html.attr("id", "App");
        angular.bootstrap($html, ["App"]);
    });
});
